Fix docker tagging for release versions#1738
Conversation
|
Thanks, this should ensure that the Docker build runs after Looks good to me. |
@trask @mre @thomas-zahner If I'm not mistaken, this is the Docker workflow run that happened when the On the plus side, the Docker command was run with On the down side:
This PR removed |
|
Yeah, you're right, just because we have a tag doesn't mean with have the release binaries. That has been haunting us for quite a while. Thats' also why - name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Wait for binary release
if: ${{ (github.event_name != 'pull_request' &&
github.actor != 'dependabot[bot]') ||
startsWith(github.ref, 'lychee-v') }}
run: |
LYCHEE_VERSION="${{ github.ref == 'refs/heads/master' && 'nightly' || 'latest' }}"
BASE_URL=$(case "$LYCHEE_VERSION" in
"latest" | "nightly") echo "https://github.com/lycheeverse/lychee/releases/latest/download";;
*) echo "https://github.com/lycheeverse/lychee/releases/download/$LYCHEE_VERSION";;
esac)
X86_URL="${BASE_URL}/lychee-x86_64-unknown-linux-gnu.tar.gz"
ARM_URL="${BASE_URL}/lychee-aarch64-unknown-linux-gnu.tar.gz"
echo "Waiting for both binaries to be available..."
while true; do
if curl -sSf --head "$X86_URL" >/dev/null 2>&1 && curl -sSf --head "$ARM_URL" >/dev/null 2>&1; then
echo "Both binaries ready!"
break
fi
sleep 20
done
- name: Push Image (debian)
uses: docker/build-push-action@v6
# ... rest of your existing configI haven't tested this, but that's my best guess. Either way, I think we should move this discussion into a follow-up issue. @eread, are you up for that? |
Not sure about that solution. I guess if it had a maximum number of iterations (rather than an infinite number), it might work ok. It's a shame that On the first issue (no release tag), I've raised: #1833. Given the actions seem to be able to be run manually (so someone can manually intervene when they fail to find a release binary and retry later), I thought the issue of no release tag was more important. |
I hope will resolve #1628
This is the relevant part of the workflow to understand what's going on:
lychee/.github/workflows/docker.yml
Lines 46 to 48 in 3592972
This is configuring
docker/metadata-action.And
type=semverEven if docker/metadata-action is being used on branch push, I think that
${{ github.ref_name }}is the branch name when the workflow is triggered by a branch push (and the tag name when the workflow is triggered by a tag push).